<h2>Modify Subject</h2>
<hr/>
<p>To modify a particular subject, enter valid information into the following fields:</p>
<center>
<div class="errorval"><?php echo validation_errors(); ?>
<?php echo $error; ?></div>
<!-- Subject information -->
<table>
<?php echo form_open('admin/catalogue_management/modifySubject/' . $subject->subject_id); ?>
<tr>
	<th width=30% align="right">Subject ID:</th>
	<td><?php echo form_hidden('subject_id', $subject->subject_id); ?><?php echo $subject->subject_id; ?></td>
</tr>
<tr>
	<th align="right">Subject Name:</th>
	<td><?php echo form_input('subject_name', $subject->subject_name); ?></td>
</tr>
<tr>
	<th class="tablehead" align="right" width=30%>Actions</th>
	<td><?php echo form_submit('', 'Submit'); ?></td>
</tr>
<?php echo form_close(); ?>
</table>
</center>

<br />
<h3 class="lefta">List of Volumes by Subject:</h3> <p><?php echo $subject->subject_name; ?></p>
<p>To remove a particular volume for the current subject, select the remove option:</p>
<!-- Volumes belonging to subject -->
<center>
<table>
<tr>
	<th>Accession Number</th>
	<th>Call Number</th>
	<th>Title</th>
	<th>Catalogue Date</th>
	<th class="tablehead">Actions</th>
</tr>
<?php
foreach ($volumes->result() as $volume)
{
	echo '<tr>';
	
	// Details
	echo '<td>' . anchor('admin/catalogue_management/viewVolume/' . $volume->access_id, $volume->access_id) . '</td>';
	echo '<td>' . $volume->call_number . '</td>';
	echo '<td>' . $volume->title . '</td>';
	echo '<td>' . $volume->catalogue_date . '</td>';
	
	// Actions
	echo '<td>';
	echo anchor('admin/catalogue_management/removeSubject/' . $subject->subject_id . '/' . $volume->access_id, 'Remove') . '</br>';
	echo '</br></td>';
	echo '</tr>';
}
?>
</table>
</center>
<br />